package com.xmim.core.session.user;


import com.xmim.core.session.DefaultSessionManager;
import com.xmim.core.session.Session;
import com.xmim.core.session.SessionListener;

import java.util.Collections;
import java.util.Enumeration;
import java.util.Map;

public class DefaultUserSessionManager extends DefaultSessionManager<UserSession> implements UserSessionManager {

    @Override
    public DefaultUserSessionManager addSession(String sessionId, Session session) {
        return (DefaultUserSessionManager) super.addSession(sessionId, session);
    }

    @Override
    public DefaultUserSessionManager addSessionListener(SessionListener sessionListener) {
        return (DefaultUserSessionManager) super.addSessionListener(sessionListener);
    }

    @Override
    public UserSession getSession(String sessionId) {
        return (UserSession) super.getSession(sessionId);
    }

    @Override
    public Enumeration<Map.Entry<String, UserSession>> enumeration() {
        Map<String, UserSession> userSessionMap = this.getSessionMap();
        return Collections.enumeration(userSessionMap.entrySet());
    }
}
